package com.examples.conversion;

public class Primitive2String {

	public String IntToString(int a) {
		Integer i = a ;
		String s = i.toString();
		return s;
	}
	public String DoutoString(double d) {
		Double i = d ;
		
		Character c;
		Double d1;
		Float f;
		Boolean B;
		Short s1;
		Byte b;
		
		String s = i.toString();
		return s;
		
		
	}
	public static void main(String[] args) {
		// Primitive to String
				System.out.println("\nPrimitive to String");
				Primitive2String obj = new Primitive2String();
				System.out.println(obj.IntToString(5));
				System.out.println(obj.DoutoString(5.0));
				//6-8-2013
			// Alternate method 
				System.out.println("\n\nAlternate method");
				int a = 5;
				String str = "" + a;
				System.out.println(str.toString());
				double a1 = 5;
				String str1 = "" + a1;
				System.out.println(str1.toString());
				
				
	}
}
